
require 'find'

def countlines(path)
  cnt = 0
    Find.find(path) do |f|
      if File.file?(f)
        File.open(f,'r').each do
          cnt += 1
        end
      end
    end
  puts cnt
end

#~ countlines('E:/workspace/yellowpages/lui')
countlines('C:\Documents and Settings\chirantan_rajhans\Desktop\COE')
